package com.bianmaba.activiti.listeners;

import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.impl.persistence.entity.VariableInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @program: example-spring-boot-extend
 * @description:
 * @author: Chenjiabin
 * @create: 2019/9/6 17:55
 **/

@Component
public class TaskCreateExpressionListener {
    @Autowired
    private TaskService taskService;

    public void onCreate(DelegateExecution execution, Task task) {
        Map<String, VariableInstance> variableInstances = taskService.getVariableInstances(task.getId());
        Map xxx = taskService.getVariableInstances(task.getId());
        System.out.println("custom listener");
    }
}
